package inventory.mappers;

import inventory.entity.Role;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import inventory.entity.po.RolePo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author sxt
 * @since 2019-11-06
 */
@Repository
public interface RoleMapper extends BaseMapper<Role> {

    /**
     * 查询所有城市
     * @return list 对象
     */
    List queryAllCity();

    /**
     * 查询所有县
     * @return list 对象
     */
    List queryAllCounty();
    String queryPidByRoleId(String roleId);
    String queryStateByRoleId(String roleId);
    List<String> queryAllRoleId();
    List<String> queryRoleIdByPid(List<String> resList);

    Role selectSubCityRoleByManagerId(@Param("managerId") String managerId);
    List<RolePo> selectSubCountyRolesByRoleId(@Param("roleId") String roleId);
    List<Role> selectSubCountyEmployeeRolesByRoleId(@Param("roleId") String roleId);

    void insertCountyRole(@Param("roleId") String roleId,@Param("role")String roleCounty,@Param("pid") String cityRoleId,@Param("state") String state);
    void insertCountyEmployeeRole(@Param("roleId") String roleId2,@Param("role") String roleCountyEmployee,@Param("pid") String roleId, @Param("state") String state);

    void deleteRoleByRoleId(String roleId);
    void updateRoleByRoleId(@Param("role") String role,@Param("roleId") String roleId);
}
